package com.wclass.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.wclass.entity.CourseWare;
import com.wclass.mapper.CourseWareMapper;
import com.wclass.service.ICourseWareService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 课件 服务实现类
 * </p>
 *
 * @author 张浩高
 * @since 2018-12-20
 */
@Service
public class CourseWareServiceImpl extends ServiceImpl<CourseWareMapper, CourseWare> implements ICourseWareService {

    /**
     * 根据课程统计课件
     * @param page
     * @param userId
     * @return
     */
    @Override
    public Page<Map<String, Object>> selectCourseWareCount(Page<Map<String, Object>> page, Long userId) {
        return page.setRecords(this.baseMapper.selectCourseWareCount(page, userId));
    }

    @Override
    public List<Map<String, Object>> selectCourseWareCountByCourseId(Long userId, Long courseInfoId) {
        return this.baseMapper.selectCourseWareCountByCourseId(userId, courseInfoId);
    }

}
